<?php

App::uses('AppModel', 'Model');

class ShippingFeeModel extends Model {
    public $useTable = 'm_shipping_fee';

    // Use primaryKey
    public $primaryKey = 'id';

    public function getInfoFrmShippingFee($mode) {
        $params = array();
        // Set fields params
        $params['fields'] = array(
      							   'ShippingFeeModel.id',
        						   'ShippingFeeModel.shipper_cd',
                                   'ShippingFeeModel.area_cd',
                                   'ShippingFeeModel.delivery_fee'
                                   );
		if ($mode != 'list')  {
	        // Set condition params
	        $params['conditions'] = array('OR' => array('ShippingFeeModel.delivery_fee' => '0')
		                      		);
		}
        return $this->find('all', $params);
    }
}
